package main;


import java.io.IOException;
import java.net.UnknownHostException;

import birdsong.client.GraphicalInterface;
import birdsong.comm.implemented.ClientComm;
import birdsong.comm.implemented.ServerComm;
import birdsong.server.Server;

public class Main {

	/**
	 * @param args
	 * @throws IOException 
	 * @throws UnknownHostException 
	 */
	public static void main(String[] args) throws UnknownHostException, IOException {
		
		ClientComm clientComm = new ClientComm();
		ClientComm clientComm2 = new ClientComm();
		ClientComm clientComm3 = new ClientComm();

	//	BirdsongClientPrototype client = new BirdsongClientPrototype();
	//	client.start(clientComm);

	
		
		
		Thread t = new Thread(new Runnable() {
			
			@Override
			public void run() {
				ServerComm serverComm = new ServerComm();
				//serverComm.start();
				Server server = new Server();
				server.start(serverComm);
			}
		});
		
		
		t.start();
		
		GraphicalInterface g = new GraphicalInterface();
			g.start(clientComm);
			
			
			GraphicalInterface g2 = new GraphicalInterface();
				g2.start(clientComm2);
				
				GraphicalInterface g3 = new GraphicalInterface();
				g3.start(clientComm3);
			
		
//		ServerComm comm = new ServerComm();
//		comm.start();
//		
//		
//		
//		
//		ClientComm client = new ClientComm();
//		client.connect(null, "ze");
//	
//		
//		comm.sendClientConnected("ze", "ze");
//		comm.sendBirdsongMessage("ze", "ze", "ola2");
//		comm.sendBirdsongMessage("ze", "ze", "ola3");
//		comm.sendBirdsongMessage("ze", "ze", "ola4");
//		comm.sendBirdsongMessage("zess", "zes", "ola2");
//
//		client.sendBirdsongMessage("OLA sou uma mensagem para os meus followers");
//		//client.disconnect();
//		System.out.println(client.isConnected());
//		
//		//client.disconnect();
		

	}

}
